/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.borrowtracing.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.borrowtracing.model.*;
import cn.edu.pku.wxlib.borrowtracing.service.*;
import cn.edu.pku.wxlib.borrowtracing.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Borrowtracing extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Borrowtracing";
	public static final String ALIAS_BORROW_TRACING_ID = "borrowTracingId";
	public static final String ALIAS_USER_TO_BOOK_BORROW_ID = "借阅id";
	public static final String ALIAS_ADMIN_ID = "管理员id";
	public static final String ALIAS_OPERATE_TYPE = "操作类型（1借；2续借；3还；4丢失）";
	public static final String ALIAS_OPERATE_TIME = "operateTime";
	public static final String ALIAS_REMARK = "128";
	
	//date formats
	public static final String FORMAT_OPERATE_TIME = DATE_TIME_FORMAT;
	
	//columns START
    /** borrowTracingId       db_column: borrowTracingId */	
	
	private java.lang.Integer borrowTracingId;
    /** 借阅id       db_column: userToBookBorrowId */	
	@NotNull 
	private java.lang.Integer userToBookBorrowId;
    /** 管理员id       db_column: adminId */	
	@NotNull 
	private java.lang.Integer adminId;
    /** 操作类型（1借；2续借；3还；4丢失）       db_column: operateType */	
	
	private java.lang.Integer operateType;
    /** operateTime       db_column: operateTime */	
	
	private java.util.Date operateTime;
    /** 128       db_column: remark */	
	@Length(max=255)
	private java.lang.String remark;
	//columns END

	public Borrowtracing(){
	}

	public Borrowtracing(
		java.lang.Integer borrowTracingId
	){
		this.borrowTracingId = borrowTracingId;
	}

	public void setBorrowTracingId(java.lang.Integer value) {
		this.borrowTracingId = value;
	}
	
	public java.lang.Integer getBorrowTracingId() {
		return this.borrowTracingId;
	}
	public void setUserToBookBorrowId(java.lang.Integer value) {
		this.userToBookBorrowId = value;
	}
	
	public java.lang.Integer getUserToBookBorrowId() {
		return this.userToBookBorrowId;
	}
	public void setAdminId(java.lang.Integer value) {
		this.adminId = value;
	}
	
	public java.lang.Integer getAdminId() {
		return this.adminId;
	}
	public void setOperateType(java.lang.Integer value) {
		this.operateType = value;
	}
	
	public java.lang.Integer getOperateType() {
		return this.operateType;
	}
	public String getOperateTimeString() {
		return DateConvertUtils.format(getOperateTime(), FORMAT_OPERATE_TIME);
	}
	public void setOperateTimeString(String value) {
		setOperateTime(DateConvertUtils.parse(value, FORMAT_OPERATE_TIME,java.util.Date.class));
	}
	
	public void setOperateTime(java.util.Date value) {
		this.operateTime = value;
	}
	
	public java.util.Date getOperateTime() {
		return this.operateTime;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("BorrowTracingId",getBorrowTracingId())
			.append("UserToBookBorrowId",getUserToBookBorrowId())
			.append("AdminId",getAdminId())
			.append("OperateType",getOperateType())
			.append("OperateTime",getOperateTime())
			.append("Remark",getRemark())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getBorrowTracingId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Borrowtracing == false) return false;
		if(this == obj) return true;
		Borrowtracing other = (Borrowtracing)obj;
		return new EqualsBuilder()
			.append(getBorrowTracingId(),other.getBorrowTracingId())
			.isEquals();
	}
}

